<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../utils/flexible.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        ul,
        li {
            list-style: none;
        }

        a {
            text-decoration: none;
        }

        img {
            display: block;
        }

        body {
            width: 10rem;
        }

        .header {
            width: 10rem;
            display: flex;
            justify-content: space-around;
            align-items: center;
            height: 1.87rem;
            background: #f75a33;
        }

        .header a {
            font-size: 0.7rem;
            color: #fff;
        }

        .header p {
            font: 0.6rem/1rem "";
            color: #fff;
            padding-left: 0.2rem;
        }

        .header span img {
            width: 1.1rem;
            height: 1.1rem;
            padding-left: 0.27rem;
        }



        /* 内容 */

        #container ul {
            background: rgb(253, 251, 251);
        }

        #container ul li i img {
            width: 6.67rem;
            height: 4.13rem;
            margin-left: 1.5rem;
            margin-top: .5rem;
            margin-bottom: .2rem;
        }

        #container h3 {
            color: #666;
        }

        #container h3,
        p,
        span {
            margin: 0 .2rem
        }

        #container p {
            font-size: .48rem;
            color: #f75a33;
        }


        /* 底部样式 */
        #footer button {
            height: 0.85rem;
            width: 9.6rem;
            margin-left: 0.2rem;
            margin-top: 0.3rem;
            border: none;
            box-shadow: 0.03rem 0.03rem 0.1rem #666;
            color: #f89a20;
            font-weight: 600;
        }

        #footer .brand {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 0.91rem;
            background: #ff9000;
            text-align: center;
            margin-top: 0.13rem;
        }

        #footer .brand span {
            background: #ff9000;
            color: #fff;
            margin-left: 0.6rem;
            font-size: 0.6rem;
        }

        #footer .brand a img {
            height: 0.5rem;
            width: 0.5rem;
            margin-right: 0.2rem;
        }

        #login {
            text-align: center;
            display: flex;
            flex-direction: column;
            background: #f4f4f4;
        }

        #login .container {
            display: flex;
            justify-content: space-between;
            margin-top: 0.13rem;
        }

        #login .container a {
            width: 33%;
            color: #666;
            border: 0.03rem solid #ccc;
            text-align: center;
            font-size: 0.4rem;
        }

        #login p {
            margin-top: 0.27rem;
        }

        #login span {
            margin-top: 0.17rem;
        }
    </style>
</head>

<body>
    <header class="header">
        <a href="../pages/coupon.html">&lt;</a>
        <p>优惠券</p>
        <span><img src="../assets/images/header_app.png" alt=""></span>
    </header>
    <div id="container">
        <ul>
            <!-- <li>
                <h3></h3>
                <p></p>
                <span></span>
            </li>
        </ul>
    </div>
    <!-- 底部结构 -->
            <section id="footer">
                <button>更多优惠信息&gt;&gt;</button>
                <div class="brand">
                    <span>品牌排行</span>
                    <a href="#"><img src="../assets/images/more.png" alt=""></a>
                </div>
            </section>

            <div id="login">
                <div class="container">
                    <a href="#">登入</a>
                    <a href="#">注册</a>
                    <a href="#" class="gotop">返回顶部</a>
                </div>
                <p>手机APP下载 慢点买手机版--掌上比价平台</p>
                <span>m.mandianmai.com</span>
            </div>
</body>

</html>
<script src="../utils/qr.js"></script>
<script src='https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js'></script>
<script>
    let con = document.querySelector('#container ul')
    let url = location.search

    // console.log(location.search);

    fetch("http://chst.vip:1234/api/getcouponproduct" + url)
        .then(body => body.json())
        .then(res => {
            console.log(res)
            let html = ""
            res.result.forEach(item => {
                html +=
                    `
                    <li><i>${item.couponProductImg}</i>
                        <h3>${item.couponProductName}</h3>
                        <p>${item.couponProductPrice}</p>
                        <span>${item.couponProductTime}</span>
                    </li>
                    `
            })

            con.innerHTML = html;
        })
</script>